'use strict';

const Controller = require('egg').Controller;
const { ObjectId } = require("mongodb")
class DetailController extends Controller {
    async index() {
        const { ctx } = this;
        // console.log(ctx.query);
        var { _id } = ctx.query;
        // console.log(_id);
        var db = this.app.mongodb;
        const collection = await db.collection('member');
        var des = await collection.find({ _id: ObjectId(_id) }).toArray();
        // console.log(des);
        ctx.body = des;
    }
}

module.exports = DetailController;
